﻿/*------------------------------------------------------------------------

RENDER.HPP v1.2.5

Copyright 楊志賢 CxxlMan, 2012 - 2013
All Rights Reserved


------------------------------------------------------------------------*/

#if !defined(__RENDER_HPP_Cxxl3D)
#define __RENDER_HPP_Cxxl3D

#include <CENTRALIZEDMGR.HPP>
#include <Sys\CAMERA.HPP>

// 元件介面的識別碼
#define IRender_ClassID L"A22635AE-0350-4803-AF4A-0E9EF452E4AA"


namespace Cxxl3D
{


class IRender:virtual public CxxlMan::cxxlPreserve2
{
  CxxlMan::P2Smart_Set<ICamera>  m_Camera_Set;

protected:

  virtual bool cxxlFASTCALL Ref(CxxlMan::Filter *F) = 0
  {
    if(F != NULL && cxxlPreserve2::Ref(F))
      return true;
    else
      return false;
  }

public:
  // Constructor
  IRender()
    :cxxlObject(CxxlMan::Spirit_Easy),
    cxxlPreserve2(IRender_ClassID),
    m_Camera_Set(this,L"Camera")
  {
  }

  // Destructor
  virtual ~IRender(){}


  void cxxlFASTCALL AddCamera(const CxxlMan::Smart_Ptr<ICamera> &Camera_Arg)
  {
    m_Camera_Set.Add(Camera_Arg);
  }

  void cxxlFASTCALL DeleteCamera(const CxxlMan::Smart_Ptr<ICamera> &Camera_Arg)
  {
    m_Camera_Set.Delete(Camera_Arg);
  }

  void cxxlFASTCALL ClearCamera()
  {
    m_Camera_Set.Destroy();
  }

  CxxlMan::Smart_Ptr<CxxlMan::cxxlList<ICamera> > cxxlFASTCALL GetCameraList() const
  {
    return m_Camera_Set.GetList();
  }

  // 若回覆 false 表示有某個 IRenderDatagram 找不到對應的 IDatagramDisposal
  virtual bool cxxlFASTCALL Draw() = 0;


  friend class CxxlMan::IcxxlStorage;
  friend class CxxlMan::Smart_Ptr<IRender>;
};


}   /* namespace Cxxl3D */
#endif

